<?php 
	//CORS跨域服务器端设置头信息
	header("Access-Control-Allow-Origin:*");
	$username = $_POST["username"];	
	include "connect.php";
	//查询数据库
	$sql = "SELECT * FROM mall WHERE username = '$username'";
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result,MYSQL_ASSOC);
	if($row){
		$arr = array("res_code"=>1,"res_body"=>"该用户名已被注册");
		echo json_encode($arr);
	}else{
		$arr = array("res_code"=>0,"res_body"=>"该用户名能够注册");
		echo json_encode($arr);
	}
	mysql_close();
 ?>